import java.io.File;
import java.io.PrintWriter;

public class Demo {
	static String HOME = "../resgod/go.sh";
	static int NODES = 31;
	static String ALG = "MyMean";
	static String PRUN = "prun -np 1 -t 01:15:00 java -Xms6G -Xmx22G " + ALG;
	static String VAL = "val";

	/* Printer globals */
	static File file;
	static PrintWriter pw;

	public static void main(String[] args) {
		setupWriter();
		printBody();
		VAL = "tes";
		printBody();
		pw.close();
	}

	private static void setupWriter() {
		file = new File(HOME);

		try {
			pw = new PrintWriter(file);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static void printBody() {
		int blockSize = 1000990 / NODES;

		for (int begin = 0; begin < 1000990; begin += blockSize) {
			int end = begin + blockSize;
			if (end > 1000990) {
				end = 1000990;
			}

			print(PRUN + " ");
			print(begin + " " + end + " " + VAL);
			println(" < /dev/null &");
		}
	}

	static void print(String string) {
		pw.print(string);
		System.out.print(string);
	}

	static void println(String string) {
		pw.println(string);
		System.out.println(string);
	}
}
